package com.maserb.monitor.wechat;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class WeChatPayConfig {
    /**
     * token标记
     */
    @Value("${weChat.token}")
    public String TOKEN;
    /**
     * APPID
     */
    @Value("${weChat.appId}")
    public String APPID;
    /**
     * 密匙
     */
    @Value("${weChat.appSecret}")
    public String APPSECRET;
    /**
     * 商户号ID
     */
    @Value("${weChat.mchId}")
    public String MCH_ID;
    /**
     * 商品API_KEY
     */
    @Value("${weChat.apiKey}")
    public String API_KEY;

    /**
     * 服务器回调域名
     */
    @Value("${weChat.notifyUrl}")
    public String REDIRECT_URI_HOME;

    /**
     * OPEN主页域名
     */
    @Value("${weChat.openUrl}")
    public String OPEN_URL_BASE = "https://open.weixin.qq.com";
    /**
     * API主页域名
     */
    @Value("${weChat.apiUrl}")
    public String API_URL_BASE = "https://api.weixin.qq.com";
    /**
     * API主页域名
     */
    @Value("${weChat.serverUrl}")
    public String MCH_URL_BASE = "https://api.mch.weixin.qq.com";

    /**
     * 获取access_token的API-URL:获取access_token时grant_type应填写client_credential
     */
    public String API_URL_ACCESSTOKEN = API_URL_BASE + "/cgi-bin/token?grant_type=client_credential&appid=" + APPID + "&secret=" + APPSECRET;

    /**
     * 获取JSAPI-TICKET的API-URL:需要加上获取的ACCESS_TOKEN
     */
    public String API_URL_JSAPITICKET = API_URL_BASE + "/cgi-bin/ticket/getticket?type=jsapi&access_token=";

    /**
     * 统一下单,订单获取接口
     */
    public String API_URL_MCHPAY_UNIFIEDORDER = MCH_URL_BASE + "/pay/unifiedorder";
}
